<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>control::Count</title>
  <meta http-equiv='Content-type' content='text/html;charset=UTF-8' />
  <link rel='stylesheet' type='text/css' href='../style.css'/>
</head>
<body>
<p>
  <a href='../index.html'>
    <img src='../logo.png' alt='Sedona'/>
  </a>
</p>
<div class='nav'>
  <a href='../index.html'>Index</a> |
  <a href='../api.html'>Kits</a> |
  <a href='index.html'>control</a>
</div>
<h1 class='title'>control::Count</h1>
<hr/>
<pre class='inheritance'><a href='../sys/Obj.html'>sys::Obj</a>
  <a href='../sys/Virtual.html'>sys::Virtual</a>
    <a href='../sys/Component.html'>sys::Component</a>
      control::Count
</pre>
<em>public </em> class <b>Count</b>  [niagaraIcon=&#x22;module://icons/x16/control/util/step.png&#x22;]<br>
<hr/>
<p>pulse counter object, counts transitions form 0 to 1 of input &#x22;in&#x22;&#xa;Counts up if dir == true, counts down if dir == false&#xa;Forced to preset value if enable = false&#xa;In the case where dir == false, the counter will stop counting down at 0</p>
<hr/>
<dl>
<dt>dir</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>bool dir</b> [config, falseText=&#x22;down&#x22;, defaultOnClone, trueText=&#x22;up&#x22;]

</code></p>
<p>Configures direction.  True = &#x22;up&#x22;, False = &#x22;down&#x22;</p>
</dd>
<dt>enable</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>bool enable</b>

</code></p>
<p>enable input</p>
</dd>
<dt>execute</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> <em>override</em> </em><b>void execute()</b>

</code></p>
<p>increment/decrement the count on rising edge of &#x22;in&#x22; if &#x22;enable&#x22; is true</p>
</dd>
<dt>in</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>bool in</b>

</code></p>
<p>input, transitions from false to true increment out by 1</p>
</dd>
<dt>out</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>int out</b> [readonly]

</code></p>
<p>Number of times &#x22;in&#x22; property has transitioned from 0 to 1</p>
</dd>
<dt>preset</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>int preset</b> [config, defaultOnClone]

</code></p>
<p>Presets the counter to a specific value, defaults to 0</p>
</dd>
<dt>r</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>bool r</b>

</code></p>
<p>if r is true, out = preset and no counting takes place</p>
</dd>
<dt>reset</dt>
<dd><p class='sig'><code><em><em>public</em> <em>action</em> </em><b>void reset()</b>

</code></p>
<p>Resets the counter to the &#x22;preset&#x22; value</p>
</dd>
<dt>start</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> <em>override</em> </em><b>void start()</b>

</code></p>
<p>Override of start method to initialize the counter</p>
</dd>
</dl>
<div class='nav'>
  <a href='../index.html'>Index</a> |
  <a href='../api.html'>Kits</a> |
  <a href='index.html'>control</a>
</div>
<div class='copyright'>Copyright &#169; 2009, Tridium, Inc.</div>
</body>
</html>
